package com.lxit.dao;

import com.lxit.pojo.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface AdminMapper {
    @Delete({
        "delete from tb_admin",
        "where name = #{name,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String name);

    @Insert({
        "insert into tb_admin (name, pass)",
        "values (#{name,jdbcType=VARCHAR}, #{pass,jdbcType=VARCHAR})"
    })
    int insert(Admin record);

    int insertSelective(Admin record);

    @Select({
        "select",
        "name, pass",
        "from tb_admin",
        "where name = #{name,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    Admin selectByPrimaryKey(String name);

    int updateByPrimaryKeySelective(Admin record);

    @Update({
        "update tb_admin",
        "set pass = #{pass,jdbcType=VARCHAR}",
        "where name = #{name,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(Admin record);
}